/*
 * Constants.h
 *
 *  Created on: 10.08.2011
 *      Author: Blinov Kirill
 *   Copyright: LGPL
 *
 */

#ifndef CONSTANTS_H_
#define CONSTANTS_H_

#include "BasicTypes.h"
#include <string>

const unsigned int   NETWORK_MIN_QUEUE_LENGHT  = 15;
const unsigned int   NETWORK_MAX_QUEUE_LENGHT  = 100;
const unsigned char   NETWORK_PROTOCOL_VERSION  = 1;

/*
 * Network message groups
 */
const unsigned char NET_MESSAGE_GROUP_STATE = 0x01;
const unsigned char NET_MESSAGE_GROUP_ACTION = 0x02;
const unsigned char NET_MESSAGE_GROUP_DATA = 0x03;

/*
 * Network message value in group
 */
const unsigned char NET_MESSAGE_ACTION_ESTABILISHED = 0x01;
const unsigned char NET_MESSAGE_ACTION_GREETING     = 0x02;
const unsigned char NET_MESSAGE_ACTION_REJECTION    = 0x03;
const unsigned char NET_MESSAGE_ACTION_REQUEST      = 0x04;

/*
 * Additional data values for different message types
 */
const unsigned int NET_MESSAGE_ADD_INITIAL_GREETING = 0x00000001;
const unsigned int NET_MESSAGE_ADD_ACCESS_REJECTION = 0x00000002;
const unsigned int NET_MESSAGE_ADD_CONNECTION_BREAK = 0x00000003;
const unsigned int NET_MESSAGE_ADD_CHECK_CONNECTION = 0x00000004;
const unsigned int NET_MESSAGE_ADD_CONFIRM_CONNECTION = 0x00000005;

const unsigned int DEFAULT_NETWORK_WAIT_FOR = 200;

const unsigned char CREATE_CONNECTION_RESULT_NEXT = 0x01;
const unsigned char CREATE_CONNECTION_RESULT_OK   = 0x02;

enum  enm_Errors
{
	ERROR_NETWORK_NONE = 0,
	ERROR_NETWORK_UNKNOWN_ERROR,
	ERROR_NETWORK_ACCESS_DENIED
};

/*
 * Global constants
 */
const unsigned int APPLICATION_CURRENT_VERSION = 0x00000001;
const unsigned int MAX_PLAYERS_COUNT = 32;

#endif /* CONSTANTS_H_ */
